package com.apobates.forum.toro.tuple;

/**
 * 元组映射器, PairMapper和TripleMapper的快捷入口
 * @since 20220827
 * @author xiaofanku@live.cn
 */
public class TupleMapper {
    public final static PairMapper pair = pair();
    public final static TripleMapper triple = triple();

    /**
     * 返回一个Pair映射器
     * @return
     */
    private static PairMapper pair(){
        return new PairMapper();
    }

    /**
     * 返回一个Triple映射器
     * @return
     */
    private static TripleMapper triple(){
        return new TripleMapper();
    }

    public static class TripleMapper {
        /**
         * 返回单一左对象Pair映射语句
         * @return
         * @param <L> 左对象类型
         */
        public static <L> TripleMapperStatements<L> one() {
            return new TripleMapperStatements<>();
        }

        /**
         * 返回多个左对象Pair映射语句
         * @return
         * @param <L> 左对象类型
         */
        public static <L> TripleManyMapperStatements<L> many() {
            return new TripleManyMapperStatements<>();
        }
    }

    public static class PairMapper {
        /**
         * 返回单一左对象Pair映射语句
         * @return
         * @param <L> 左对象类型
         */
        public static <L> PairMapperStatements<L> one() {
            return new PairMapperStatements<>();
        }

        /**
         * 返回多个左对象Pair映射语句
         * @return
         * @param <L> 左对象类型
         */
        public static <L> PairManyMapperStatements<L> many() {
            return new PairManyMapperStatements<>();
        }
    }
}
